package com.xuecheng.content.convert;

import com.xuecheng.api.content.model.dto.CourseBaseDTO;
import com.xuecheng.api.content.model.vo.CourseAuditVO;
import com.xuecheng.api.content.model.vo.CourseBaseVO;
import com.xuecheng.content.entity.CourseBase;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * <p></p>
 *
 * @Description:
 */
@Mapper
public interface CourseBaseConvert {

    CourseBaseConvert INSTANCE = Mappers.getMapper(CourseBaseConvert.class);

    @Mapping(source = "id",target = "courseBaseId")
    CourseBaseDTO entity2dto(CourseBase courseBase);

    @Mappings({
            @Mapping(target = "id", source = "courseBaseId")
    })
    CourseBase dto2entity(CourseBaseDTO student);

    CourseBaseDTO vo2dto1(CourseBaseVO vo);
    /*
    * 集合数据转化需要依赖于单个数据转化的方法
    *   entitys2dtos   -->  entity2dto
    * */
    List<CourseBaseDTO> entitys2dtos(List<CourseBase> courseBase);

    CourseBaseDTO audit2dto(CourseAuditVO courseAuditVO);
}
